﻿namespace SuperModel.Behaviors
{
    using System;

    /// <summary>
    /// Models generated with the MarksDirty attribute will set the model's IsDirty property = true when properties change.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Property)]
    public class MarksDirtyAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MarksDirtyAttribute"/> class.
        /// </summary>
        public MarksDirtyAttribute()
            : this(true)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MarksDirtyAttribute"/> class.
        /// </summary>
        /// <param name="marksDirty">
        /// The marks dirty.
        /// </param>
        public MarksDirtyAttribute(bool marksDirty)
        {
            MarksDirty = marksDirty;
        }

        /// <summary>
        /// Gets or sets a value indicating whether the target Marks Dirty.
        /// </summary>
        public bool MarksDirty { get; set; }
    }
}